{extend name='admin@main'}

{block name="button"}
<!-- {if auth("add")}
<button data-modal='{:url("add")}' data-title="添加企业员工" class='layui-btn layui-btn-sm layui-btn-primary'>添加企业员工</button>
{/if}

{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些员工吗？" action="{:url('department/remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除企业员工</button>
{/if}
 -->
{/block}

{block name="content"}
{php}
{//var_dump($list_apply);}
{//var_dump($list);}
{/php}
<div class="think-box-shadow">
    {include file='user/index_search'}
    <table class="layui-table" lay-skin="line">
        
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>员工姓名</th>
            <th class='text-left nowrap'>员工身份</th>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['roleid'] == 1}
            <th class='text-left nowrap'>公司名称</th>
            {/if}
			<th class='text-left nowrap'>部门名称</th>
            <th class='text-left nowrap'>手机号</th>
            <th class='text-center nowrap'>员工状态</th>
          <!--   <th class='text-left nowrap'>添加时间</th> -->
            <th class='text-left nowrap'>操作选项</th>
        </tr>
        </thead>
        
        <tbody>
     <!--    //审核列表 -->


        {foreach $list_apply as $key=>$vo}
        {if $vo.user_mobile}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='list-table-sort-td'>
   <!--              <label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.id}" class="list-sort-input"></label> -->
                <label>{$vo.id}</label>
            </td>
            <td class='text-left nowrap'>{$vo.user_name|default='未验证身份'}</td>
            <td class='text-left nowrap'>{$vo.user_roleid|default='-'}</td>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['roleid'] == 1}
            <td class='text-left nowrap'>{$vo.company_name|default='-'}</td>
            {/if}
            <td class='text-left nowrap'>{$vo.dept_name|default='-'}</td>
            <td class='text-left nowrap'>{$vo.user_mobile|default='-'}</td>
            <td class='text-left nowrap'>

            {switch name="vo.apply_status" }
               {case value='0'}<a class="margin-10" href="javascript:;"><i class="layui-icon" style="font-size: 32px;color:#FFB800 "></i>待审核</a>{/case}
               {case value='1'}<a class="margin-10" href="javascript:;"><i class="layui-icon" style="font-size: 32px;color:#009688 "></i>正常</a>{/case}
               {case value='2'}<a class="margin-10" href="javascript:;"><i class="layui-icon" style="font-size: 32px;color:#FF5722 "></i>拒绝加入</a>{/case}
               {default/}-
            {/switch}

        </td>
            <td class='text-left nowrap'>
                {if auth("state_review") and $vo.apply_status == 0}
                <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('company/company/state_review')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">同意加入</a>
                 <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('company/company/state_review')}" data-value="id#{$vo.id};status#2" data-csrf="{:systoken('state')}">拒绝加入</a>
                {elseif auth("state_review") and $vo.apply_status neq 1|0 }

                {/if}
    <!--             {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑员工信息" data-modal='{:url("edit")}?id={$vo.id}&type="edit"'>编 辑</a>
                {/if}

                {if auth("setapp")}
                    {if $vo.user_Interviewees == 1}
                            <a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="取消该员工为受访人吗？" data-action="{:url('setapp')}" data-value="id#{$vo.id};companyid#{$vo.apply_companyid};deptid#{$vo.apply_deptid};interviewees#0" data-csrf="{:systoken('setapp')}" action="{:url('user/setapp')}">取消受访人</a>
                        {else}
                            <a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="设定该员工为受访人吗？" data-action="{:url('setapp')}" data-value="id#{$vo.id};companyid#{$vo.apply_companyid};deptid#{$vo.apply_deptid};interviewees#1" data-csrf="{:systoken('setapp')}" action="{:url('user/setapp')}">设为受访人</a>

                    {/if}
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该员工吗？" data-action="{:url('remove')}" data-value="id#{$vo.id};companyid#{$vo.apply_companyid};deptid#{$vo.apply_deptid}" data-csrf="{:systoken('remove')}" action="{:url('user/remove')}">删 除</a>
                {/if}
 -->

            </td>
        </tr>
         {/if}
        {/foreach}
<!-- 
        //end -->


        {foreach $list as $key=>$vo}
        {if $vo.mobile}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='list-table-sort-td'>
   <!--              <label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.id}" class="list-sort-input"></label> -->
                <label>{$vo.id}</label>
            </td>
            <td class='text-left nowrap'>{$vo.name|default='未验证身份'}</td>
            <td class='text-left nowrap'>{$vo.role_name|default='-'}</td>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['roleid'] == 1}
            <td class='text-left nowrap'>{$vo.company_name|default='-'}</td>
            {/if}
			<td class='text-left nowrap'>{$vo.dept_name|default='-'}</td>
            <td class='text-left nowrap'><!-- {#$vo.svn_username|default='-'} -->  {$vo.mobile|default='-'}</td>
                        <td class='text-left nowrap'>

   
                <a class="margin-10" href="javascript:;"><i class="layui-icon" style="font-size: 32px;color:#009688 "></i>在职中</a>

        </td>
    <!--         <td class='text-center nowrap'> -->
<!--                 {#eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{/eq}
                {#eq name='vo.status' value='1'}<span class="color-green">在职中</span>{/eq}
                {#eq name='vo.status' value='2'}<span class="color-desc">已离职</span>{/eq} -->

      <!--       </td> -->
      
   <!--          <td class='text-left nowrap'>
                {$vo.mobile|default='-'}
            </td> -->
<!--             <td class='text-left nowrap'>
                {$vo.createtime|format_datetime}
            </td> -->
            <td class='text-left nowrap'>

                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑员工信息" data-modal='{:url("edit")}?id={$vo.id}&type="edit"'>编 辑</a>
                {/if}
<!-- 
                {if auth("state") and $vo.deleteTime neq NULL}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">启 用</a>
                {elseif auth("state")}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">禁 用</a>
                {/if} -->

                {if auth("setapp")}
                    {if $vo.Interviewees == 1}
                            <a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="取消该员工为受访人吗？" data-action="{:url('setapp')}" data-value="id#{$vo.id};companyid#{$vo.companyid};deptid#{$vo.deptid};interviewees#0" data-csrf="{:systoken('setapp')}" action="{:url('user/setapp')}">取消受访人</a>
                        {else}
                            <a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="设定该员工为受访人吗？" data-action="{:url('setapp')}" data-value="id#{$vo.id};companyid#{$vo.companyid};deptid#{$vo.deptid};interviewees#1" data-csrf="{:systoken('setapp')}" action="{:url('user/setapp')}">设为受访人</a>

                    {/if}
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该员工吗？" data-action="{:url('remove')}" data-value="id#{$vo.id};companyid#{$vo.companyid};deptid#{$vo.deptid}" data-csrf="{:systoken('remove')}" action="{:url('user/remove')}">删 除</a>
                {/if}


            </td>
        </tr>
         {/if}
        {/foreach}
        </tbody>
    </table>
<fieldset>
    <legend>操作选项</legend>
{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些员工吗？" action="{:url('department/remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除员工</button>
{/if}

</fieldset>
<fieldset>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
